fix logic from race fix