ThreadStatic fix