fix Bag.hasNext check