reset buffer length