fixed NoSuchElementException