fixed a small bug in the lib/query.js