fixed error that was crashing app