fixed connection generator method
Merge pull request #34 from antonow/more-bug-fixes

fixed connection generator method