Fixed the update password middleware bug.