Quick fix to avoid potential NoSuchElementException