now handles network errors and request canceling