add check_constraint method