Properly deal with connection failures