add constraint check