page fragment for autocomplete refactored in order to prevent NoSuchElementException