Avoiding minor race condition