Support exiting the app properly