fix mt-safe problem.