Added cancelTaskById method