add connection termination listener
remove console logs
Merge pull request #199 from will123195/handle-disconnect

add connection termination listener