added network connection check