add thread safe implement.