Fix not checking internet connectivity correctly