another way to wait until the page has loaded