bail out in case of protocol errors or connection failure