Fix incorrect disabling of cancel UI in some cases