Fix potential race