Add entity_type check