Changed i to item_idx