added validation for fields