Added code to exit the application.