Fix stopping the application