Add ids to lookup refs