make sure file buffer is cleared