Correctly exit when page fails to load