small fix in doDisconnect