Fixed the bug that would crash the app.