fix for #118. favor events over polling. wait for page to load