Fixes duplicate connection bug.
Merge pull request #1 from JosephX/patch-1

Fixes duplicate connection bug.