Before hook waits for page to load.