Fixing  logged state view after refresh and delayed api call