fixed connection failure error handling