adding validation to the models