Implemented a way to clean up the tmp files that are created when closing the application.