Added validation to model