updated localstorage code, V1.4.1