final updates to query builder