ensuring buffer resets