Fix the cancel bug