fix query string encoding to deal with ampersands