add more checking before testing page

Also trying to see if this can fix the issue with sd firefox.