clear the buffer between frames