Fixes duplicate connection bug.