Fix up race condition