issue $5281: fix disconnect bug