add localstorage support.