Fixed a problem making the app to crash