Fix  condition testing