pushState before dispatch

Otherwise, window.location.pathname does not give accurate representation of current route upon dispatch