Add constrainst checking