Attempt making thread-safe
Merge pull request #4 from JTGround/dev

Attempt making thread-safe