handle the connect failure case