add thread-safe feature