Fixed a bug which caused the app to crash at startup