fixing bugs when auth client is not yet loaded.