fix localstorage and clear code

fix localstorage and clear code