updated query.js