Avoid race condition.