Fix value of origin_id when more than one origin is indexed
origin was a leftover from the previous for loop.