better cancellation handling