Added cancellation support to dialog closes #15.