reorder query params to avoid punctuation at end of URL.