Modify to stop the application