added validation for entity type