bugfix: stop processing when there are no query entries.