simplify cancel logic