diff --git a/install/class/Class_Install.php b/install/class/Class_Install.php
index 15705c123e27b1e9e4609f6e8e7e513893405add..73240400528ec17035c52f02ac4b4ca605318444 100755
--- a/install/class/Class_Install.php
+++ b/install/class/Class_Install.php
@@ -2147,7 +2147,8 @@ class Install extends functions
         $db = new Database();
 
         $query = "UPDATE users SET password=? WHERE user_id='superadmin'";
-        $db->query($query, [\Core\Models\SecurityModel::getPasswordHash($newPass)]);
+        $sec = new security();
+        $db->query($query, [$sec->getPasswordHash($newPass)]);
     }
 
     function copy_dir($dir2copy, $dir_paste, $excludeExt=false)
diff --git a/install/scripts/password.php b/install/scripts/password.php
index 8fd6e535c6c37fe39ac8692d020d9d11175269f2..22e55f606bae3b025407f9cce0d838f735156b4d 100755
--- a/install/scripts/password.php
+++ b/install/scripts/password.php
@@ -32,14 +32,14 @@
     include_once '../../core/init.php';
     require_once('install/class/Class_Install.php');
     $Class_Install = new Install;
-
 //CONTROLLER
-    if (!isset($_REQUEST['newSuperadminPass']) || empty($_REQUEST['newSuperadminPass'])) {
+    $trimmedPassword=rtrim($_REQUEST['newSuperadminPass']);
+    if (!isset($_REQUEST['newSuperadminPass']) || empty($trimmedPassword)) {
         header("Location: ../error.php?error=badForm"); exit;
     }
-
-    $Class_Install->setSuperadminPass(
+    $resp=$Class_Install->setSuperadminPass(
         $_REQUEST['newSuperadminPass']
     );
+    
 
-    header("Location: ../index.php?step=resume");
+    header("Location: ../index.php?step=config");
\ No newline at end of file
diff --git a/install/view/password_view.php b/install/view/password_view.php
index 86b6c7aa43235674b415256c408141c571dd8b1b..04be8f89a1a2bc8d4793ebc37d89b51651fd4818 100755
--- a/install/view/password_view.php
+++ b/install/view/password_view.php
@@ -74,7 +74,7 @@
             <h6>
                 <?php echo _PASSWORD_EXP;?>
             </h6>
-            <form action="scripts/password.php" method="post">
+            <form action="scripts/password.php" method="post" id="newAdminPassForm" name="newAdminPassForm">
                 <table>
                     <tr>
                         <td>
@@ -120,7 +120,7 @@
                     </a>
                 </div>
                 <div style="float: right;" class="nextButton" id="next">
-                    <a href="#" onClick="goTo('index.php?step=config');" id="okAdminPass" style="display: none;">
+                    <a href="#" onClick="document.getElementById('newAdminPassForm').submit();" id="okAdminPass" style="display: none;">
                         <?php echo _NEXT_INSTALL;?>
                     </a>
                 </div>