added validation to model