fix a bug of disconnection