added localstorage support