Added a network connection check