fixed #867 - added proper detection so that onpopstate would not react if it was a proper page load