added network connectivity error handling