refactor call checkConstraint