fix up the query string