Correcting query string to link url