Added support for cancellation