fix `query` undefined during `LOG_QUERIES=true`
Merge pull request #146 from ruffrey/master

fix `query` undefined during `LOG_QUERIES=true`