fix duplicated disconnect/error event bug

Change-Id: I51afb8da56a0bf2dc35a0beb16b6c0dc07a1e9fd