fix for a cancelation race condition