replaced the cookies with localstorage