replaced cookies with localstorage