Added functionality to pause and quit app on pressing back button.