Resolve race condition