Added waitForIdle