Fixing cancellation exception