wait for pages to be properly loaded