Fixed a bug where navigate to /?someparam=somevalue will get url truncated

The line I edited was supposed to removed an unnecessary trailing slash in the URL, so what I did is to check if the trailing character is actually a slash, which I guess should make sense.

We ran into an issue where we are navigating to home(/) page with some params, and the last character gets removed.

Thanks.