How to run the application in the background when it is closed