Fixed a bug that caused the app to crash when using the back button.