double buffer size to prevent overflow