update the constraint similar logic.