and then fix the race condition in the localstorage situation...