prepare for multithread problem situation