Thread_local for thread safety