Fixed issue #9 thread local issue.