Old code + patches - disconnection code