Added check of cancellation before delivery complete.