changed the locality to Thread local