changes to query parsing