added unique type_id to entity_type