add network error handling