try adding the function the page should be on in the history state, then
call the function when it's poped from the state