Changed waiting for page to load