use localstorage instead of cookie