implementing isCancelled and isDone