Fixes issue with thread-safety on with-db
Merge pull request #236 from ceterumnet/master

Fixes issue with thread-safety on with-db