State saving added on application stop event.