fix the lastPage / leave() logic to store and use full url state, and have better logic