Add disconnection logic