change id to entity_id