fixing popstate events in FF and IE