Added support for localstorage