avoid Set race condition