add validation to model