Fix browser's back/forward buttons functionality

Thanks for the feedback in HN https://news.ycombinator.com/item?id=6586720