fix localstorage bugs, complete storage system