fix canceled detection