use the browser history to push and pop states