fixed NoSuchElement on empty collection