Add try ... clause to quit gracefully when user canceled.