fixed crash bug but it's weird now