diff --git a/Irpg/Users.pm b/Irpg/Users.pm
index 454cbbacdc29c5f3780bddf581f7f45207771ced..55839a3fd52533046a910bedbdc80fd5cf544855 100644
--- a/Irpg/Users.pm
+++ b/Irpg/Users.pm
@@ -412,7 +412,7 @@ sub chclass {
     my $cname = lc(join(' ', @arg));
     $cname =~ s/\b(\w)/\u$1/g;  # capitalize the first letter of each word
     my $cname_ = $cname;
-    my $cname_ =~ s/ /_/g;
+    $cname_ =~ s/ /_/g;
     if (!defined($username)) {
         Irpg::Irc::notice("You are not logged in.", $usernick);
         return;