processQuery() changes