delete temporary files on startup
added test
remove temporary files when opening a collection