diff --git a/beat/web/ui/static/ui/js/widgets.js b/beat/web/ui/static/ui/js/widgets.js
index 201f670ae9572ff26dce0c7f256e759ec75e512c..0a340e44210ee1eee51fd1ac4889fb8c6658b8d3 100644
--- a/beat/web/ui/static/ui/js/widgets.js
+++ b/beat/web/ui/static/ui/js/widgets.js
@@ -1,21 +1,21 @@
 /*
  * Copyright (c) 2016 Idiap Research Institute, http://www.idiap.ch/
  * Contact: beat.support@idiap.ch
- * 
+ *
  * This file is part of the beat.web module of the BEAT platform.
- * 
+ *
  * Commercial License Usage
  * Licensees holding valid commercial BEAT licenses may use this file in
  * accordance with the terms contained in a written agreement between you
  * and Idiap. For further information contact tto@idiap.ch
- * 
+ *
  * Alternatively, this file may be used under the terms of the GNU Affero
  * Public License version 3 as published by the Free Software and appearing
  * in the file LICENSE.AGPL included in the packaging of this file.
  * The BEAT platform is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  * or FITNESS FOR A PARTICULAR PURPOSE.
- * 
+ *
  * You should have received a copy of the GNU Affero Public License along
  * with the BEAT platform. If not, see http://www.gnu.org/licenses/.
 */
@@ -131,8 +131,8 @@ function process_error(data, status_text, redirect) {
       type: BootstrapDialog.TYPE_DANGER,
       title: 'Error during submission' + ' - ' + data.statusText + ' (' + data.status + ')',
       message: div,
-      onhidden: function() {
-        if (redirect !== undefined) window.location = redirect;
+      callback: function(result) {
+        if (redirect !== undefined) window.location.href = redirect;
       }
     });
   }
@@ -142,8 +142,8 @@ function process_error(data, status_text, redirect) {
       message: 'An empty response was received by your browser, for a request you sent. This normally indicates it cannot establish a connection with the web service. In the hopes it is a temporary issue, you may re-submit your request again at a later moment. Otherwise, please contact the system administrators.',
       type: BootstrapDialog.TYPE_DANGER,
       title: 'Empty response',
-      onhidden: function() {
-        if (redirect !== undefined) window.location = redirect;
+      callback: function(result) {
+        if (redirect !== undefined) window.location.href = redirect;
       }
     });
   }
@@ -152,8 +152,8 @@ function process_error(data, status_text, redirect) {
       message: data.responseJSON,
       type: BootstrapDialog.TYPE_DANGER,
       title: data.statusText + ' (' + data.status + ')',
-      onhidden: function() {
-        if (redirect !== undefined) window.location = redirect;
+      callback: function(result) {
+        if (redirect !== undefined) window.location.href = redirect;
       }
     });
   }