Added waitForPageToLoad