Switch to sessionStorage and saving history