Fix incorrect check