issue #60 fixed by introducing ThreadLocal