Fixed bug that crashed the app