fix bug that happens when using setHash in history mode