stop before disconnect