query parsing fix