Fixed a rare race issue