improved debug logging
deal with StaleElementReferenceException in pageHasLoaded() condition