Add constraint to "set" method