Added the code to fix the issue at disconnecting.#
Merge branch 'fix_bug'