diff --git a/html/cgi-bin/chpasswd.cgi b/html/cgi-bin/chpasswd.cgi
index c00caca20..46c3e02f6 100644
--- a/html/cgi-bin/chpasswd.cgi
+++ b/html/cgi-bin/chpasswd.cgi
@@ -77,11 +77,11 @@ if ($cgiparams{'SUBMIT'} eq $tr{'advproxy chgwebpwd change password'})
        # Check if a user with this name and password exists in the userdb file
        # and if it does then change the password to the new one
        my $user = &General::system_output("grep", "$cgiparams{'USERNAME'}", "$userdb");
-       my $old_password = &General::system_output("/usr/bin/htpasswd", "-bv", "$userdb", "$cgiparams{'USERNAME'}", "$cgiparams{'OLD_PASSWORD'}");
+       my @old_password = &General::system_output("/usr/bin/htpasswd", "-bv", "$userdb", "$cgiparams{'USERNAME'}", "$cgiparams{'OLD_PASSWORD'}");
        if (!$user) {
                $errormessage = $tr{'advproxy errmsg invalid user'};
                goto ERROR;
-       } elsif (!$old_password) {
+       } elsif (@old_password[0] =~ /password verification failed/) {
                 $errormessage = $tr{'advproxy errmsg password incorrect'};
                 goto ERROR;
        } else {
