Added navigationcontroller restore functionality when reopening the app.