fixed placement of error check for no internet