Improve deleting file on exit