mitigate race condition