removes temporary files on closing