fixes bug with ready race condition and impleements localstorage for user token hirearchy