fix multi-threads