Removed a race condition