Added network connection check