Adding validation to model attributes