fix waitgroup logic
Merge pull request #3 from burke/fix-wg

fix waitgroup logic