fixing local storage bug