reworking network error handling