Bug with query.hasNext()

Sorry, mistyped in example above but you can see in the console log that it was r.hasNext()