added internet connection check