Create a new method to check network availability.