Add constraint and validator