Depending on how you see it, it may or may not be a bug, but this code pushes a new url to the browser's history.
I think it would be better not to push, by passing `{ replace: true }` option as the third parameter.