Made thread local. Removed debug prints