Fixed the bug that caused the app to stop unexpectedly