added validation to models