forgot to close files on exit