added waitForAuth