diff --git a/src/commands/help.ts b/src/commands/help.ts
index c1bad9b..7214799 100644
--- a/src/commands/help.ts
+++ b/src/commands/help.ts
@@ -120,7 +120,7 @@
                         new StringSelectMenuOptionBuilder().setLabel("Select a subcommand").setValue("none").setDefault(currentPath[1] === "none"),
                         ...subcommandGroups.map((option) => new StringSelectMenuOptionBuilder().setLabel(capitalize(option.name)).setValue(option.name).setDefault(currentPath[1] === option.name))
                     )
-                if(subcommandGroupRow.components[0]!.options.find((option) => option.data.default)) {
+                if(subcommandGroupRow.components[0]!.options.find((option) => option.data.default && option.data.value !== "none")) {
                     let subsubcommands = (subcommandGroups.find((option) => option.name === currentPath[1])! as ApplicationCommandSubGroup).options?.filter((option) => option.type === ApplicationCommandOptionType.Subcommand) || [];
                     subcommandRow.components[0]!
                         .addOptions(
@@ -163,7 +163,6 @@
                 currentPath[2] = value;
                 break;
         }
-        console.log(currentPath)
 
     } while (!closed);
 };
diff --git a/src/utils/commandRegistration/register.ts b/src/utils/commandRegistration/register.ts
index 4290064..e146069 100644
--- a/src/utils/commandRegistration/register.ts
+++ b/src/utils/commandRegistration/register.ts
@@ -27,8 +27,8 @@
         const last = i === files.length - 1 ? "└" : "├";
         if (file.isDirectory()) {
             console.log(`${last}─ ${colours.yellow}Loading subcommands of ${file.name}${colours.none}`)
-            const fetched = (await import(`../../../${config.commandsFolder}/${file.name}/_meta.js`)).command;
-            commands.push(fetched);
+            const fetched = (await import(`../../../${config.commandsFolder}/${file.name}/_meta.js`));
+            commands.push(fetched.command);
         } else if (file.name.endsWith(".js")) {
             console.log(`${last}─ ${colours.yellow}Loading command ${file.name}${colours.none}`)
             const fetched = (await import(`../../../${config.commandsFolder}/${file.name}`));
@@ -171,6 +171,7 @@
 
             const fullCommandName = "commands/" + commandName + (subcommandGroupName ? `/${subcommandGroupName}` : "") + (subcommandName ? `/${subcommandName}` : "");
 
+            console.log(fullCommandName, client.commands[fullCommandName])
             const command = client.commands[fullCommandName]![0];
             const callback = command?.callback;
             const check = command?.check;
@@ -222,4 +223,5 @@
     console.log(
         (config.enableDevelopment ? `${colours.purple}Bot started in Development mode` :
         `${colours.blue}Bot started in Production mode`) + colours.none)
+    console.log(client.commands)
 };
diff --git a/src/utils/commandRegistration/slashCommandBuilder.ts b/src/utils/commandRegistration/slashCommandBuilder.ts
index a4474ac..72f92a2 100644
--- a/src/utils/commandRegistration/slashCommandBuilder.ts
+++ b/src/utils/commandRegistration/slashCommandBuilder.ts
@@ -1,4 +1,4 @@
-import type { SlashCommandSubcommandGroupBuilder } from "discord.js";
+import { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from "discord.js";
 import type { SlashCommandBuilder } from "discord.js";
 import config from "../../config/main.json" assert { type: "json" };
 import getSubcommandsInFolder from "./getFilesInFolder.js";
@@ -32,7 +32,9 @@
         if (descriptionLocalizations) { subcommandGroup.setDescriptionLocalizations(descriptionLocalizations) }
 
         for (const subcommand of fetched.subcommands) {
-            subcommandGroup.addSubcommand(subcommand.command);
+            let processedCommand = subcommand.command(new SlashCommandSubcommandBuilder());
+            client.commands["commands/" + path + "/" + processedCommand.name] = [subcommand, { name: processedCommand.name, description: processedCommand.description }]
+            subcommandGroup.addSubcommand(processedCommand);
         };
 
         return subcommandGroup;
@@ -53,6 +55,8 @@
     commandString = "commands/" + (commandString ?? path);
     const fetched = await getSubcommandsInFolder(config.commandsFolder + "/" + path);
     console.log(`│  ├─ ${fetched.errors ? colours.red : colours.green}Loaded ${fetched.subcommands.length} subcommands and ${fetched.subcommandGroups.length} subcommand groups for ${name} (${fetched.errors} failed)${colours.none}`)
+    console.log({name: name, description: description})
+    client.commands[commandString!] = [undefined, { name: name, description: description }]
     return (command: SlashCommandBuilder) => {
         command.setName(name)
         command.setDescription(description)
@@ -64,12 +68,11 @@
                 bitfield.add(userPermissions)
             command.setDefaultMemberPermissions(bitfield.bitfield)
         }
-        client.commands[commandString!] = [undefined, { name: name, description: description }]
 
         for (const subcommand of fetched.subcommands) {
             let fetchedCommand;
             if (subcommand.command instanceof Function) {
-                fetchedCommand = subcommand.command(new Discord.SlashCommandSubcommandBuilder());
+                fetchedCommand = subcommand.command(new SlashCommandSubcommandBuilder());
             } else {
                 fetchedCommand = subcommand.command;
             }
@@ -77,8 +80,9 @@
             command.addSubcommand(fetchedCommand);
         }
         for (const group of fetched.subcommandGroups) {
-            command.addSubcommandGroup(group.command);
-            client.commands[commandString! + "/" + group.command.name] = [undefined, { name: group.command.name, description: group.command.description }]
+            let processedCommand = group.command(new SlashCommandSubcommandGroupBuilder());
+            client.commands[commandString! + "/" + processedCommand.name] = [undefined, { name: processedCommand.name, description: processedCommand.description }]
+            command.addSubcommandGroup(processedCommand);
         };
         return command;
     };
diff --git a/src/utils/confirmationMessage.ts b/src/utils/confirmationMessage.ts
index 18bcd7b..43a0c8f 100644
--- a/src/utils/confirmationMessage.ts
+++ b/src/utils/confirmationMessage.ts
@@ -183,7 +183,7 @@
             let component;
             try {
                 component = await m.awaitMessageComponent({
-                    filter: (i) => i.user.id === this.interaction.user.id && i.channel!.id === this.interaction.channel!.id && i.id === m.id,
+                    filter: (i) => i.user.id === this.interaction.user.id && i.channel!.id === this.interaction.channel!.id,
                     time: 300000
                 });
             } catch (e) {
diff --git a/src/utils/getCommandDataByName.ts b/src/utils/getCommandDataByName.ts
index 0d4ac47..2d4deb7 100644
--- a/src/utils/getCommandDataByName.ts
+++ b/src/utils/getCommandDataByName.ts
@@ -18,6 +18,7 @@
 
     const split = name.replaceAll(" ", "/")
     const command = client.commands["commands/" + split]!;
+    console.log(command)
     const mention = getCommandMentionByName(name);
     return {
         name: command[1].name,
