changing behaviour on connect failure