now deletes tmp file on close