Problem when quitting/restarting the application