Fixed first similar item being lost when iterating over the list