added support for localstorage