fix condition testing