added network error handling