Add Ids to Query