fix checkConstraint