diff --git a/field_group_ajaxified_multipage.module b/field_group_ajaxified_multipage.module
index d37dfda..958486b 100644
--- a/field_group_ajaxified_multipage.module
+++ b/field_group_ajaxified_multipage.module
@@ -515,8 +515,9 @@ function _field_group_ajaxified_multipage_form_callback($form) {
 
   // Scroll to the top of the form.
   // @todo: add the form wrapper here
-  $commands[] = field_group_ajaxified_multipage_ajax_command_scroll_top('body');
   $commands[] = ajax_command_replace(NULL, $output, $settings);
+  $commands[] = array('command' => 'scrollTop',);
+  
   return array(
     '#type' => 'ajax',
     '#commands' => $commands,
@@ -524,20 +525,6 @@ function _field_group_ajaxified_multipage_form_callback($form) {
 }
 
 /**
- * Scroll to top of the current view.
- *
- * @return
- *   An array suitable for use with the ajax_render() function.
- */
-function field_group_ajaxified_multipage_ajax_command_scroll_top($selector) {
-  $command = array(
-    'command' => 'fgScrollTop',
-    'selector' => $selector,
-  );
-  return $command;
-}
-
-/**
  *
  * @param $form
  * @param $form_state
diff --git a/js/field_group_ajaxified_multipage.js b/js/field_group_ajaxified_multipage.js
index 0bf4a8e..adeaba2 100644
--- a/js/field_group_ajaxified_multipage.js
+++ b/js/field_group_ajaxified_multipage.js
@@ -1,15 +1,7 @@
-(function($){
-
-  /**
-   * Scroll to top.
-   */
-  Drupal.behaviors.scrollTop = {
-    attach: function (context, settings) {
-
-      $('html, body').animate({
-        scrollTop: $("body").offset().top
-      }, 200);
-
-    }
+(function($, Drupal){
+  Drupal.ajax.prototype.commands.scrollTop = function(ajax, response, status){
+    $('html, body').animate({
+      scrollTop: $("body").offset().top
+    }, 200);
   };
-})(jQuery);
\ No newline at end of file
+}(jQuery, Drupal));