to make sure of thread safe