Merge pull request #16 from bensarz/develop

Fixing threading bug