bug fix for cancel