Improve disconnect logic

Change-Id: Ib53f6b7ffd109040e3aa1f2c8538c0973283b6f9