added localstorage and some fixs