Adding validation to the model