diff --git a/tfa.module b/tfa.module
index c202da0..5dfb683 100644
--- a/tfa.module
+++ b/tfa.module
@@ -274,21 +274,20 @@ function tfa_login_submit($form, &$form_state) {
     $identifier = variable_get('user_failed_login_identifier_uid_only', FALSE) ? $account->uid : $account->uid . '-' . ip_address();
     flood_clear_event('tfa_user', $identifier);
     flood_register_event('tfa_begin');
-    $context = tfa_start_context($account);
+    tfa_start_context($account);
     $tfa = tfa_get_process($account);
 
     $query = drupal_get_query_parameters();
-    if (!empty($form_state['redirect'])) {
-      // If there's an existing redirect set it in TFA context and
-      // tfa_form_submit() will extract and set once process is complete.
-      $context['redirect'] = $form_state['redirect'];
-
-    }
     unset($_GET['destination']);
 
     // Begin TFA and set process context.
     $tfa->begin();
     $context = $tfa->getContext();
+    if (!empty($form_state['redirect'])) {
+      // If there's an existing redirect set it in TFA context and
+      // tfa_form_submit() will extract and set once process is complete.
+      $context['redirect'] = $form_state['redirect'];
+    }
     tfa_set_context($account, $context);
 
     $login_hash = tfa_login_hash($account);
