Don't close the file prematurely