Fix crash condition