Set query string properly