removing usage of global cancelPrm variable