fix thread_local cache