eliminate race condition