fix multi thread