Is it possible to redirect a user to avoid showing an AJAX batch processing error? I'm trying to allow users to cancel their accounts without requiring e-mail confirmation as described in this question.

Currently, when I use the following code, the user account is cancelled properly, but the AJAX display shows a nasty error.

  else {
    // Cancel the account
    user_cancel($form_state['values'], $account-&gt;uid, $form_state['values']['user_cancel_method']);




I tried adding drupal_goto('user/logout'); after user_cancel(), but this immediately logs the user out and the account is not cancelled.  What I would like to do is cancel the account, log the user out, and somehow not display this error.
I found the cause of the error-- I had a custom rule that sent an e-mail to the admin when the account was cancelled.  By deleting this rule, the error disappears and the user is logged out properly.