Thread safe support
Merge pull request #463 from billychan/replace-class-variables

Thread safe support