thread local storage fix v0