fix security issue with localstorage (fallback to memory)