Fixed possible cause of crash