add timeout for waitForPage