use thread local variables