Implemented cancel for operations.