more changes on connection related issue
Merge pull request #583 from skpcharles/master

more changes on connection related issue