registered for UIApplicationWillTerminateNotification.