fix race condition
fix race condition