fix cancellation bug.