updating buildQuery.js