fix network error handling