Fix bug for ThreadLocal