diff --git a/src/context/users/userinfo.ts b/src/context/users/userinfo.ts
index 9c7433f..b215685 100644
--- a/src/context/users/userinfo.ts
+++ b/src/context/users/userinfo.ts
@@ -4,10 +4,13 @@
 const command = new ContextMenuCommandBuilder().setName("User info");
 
 const callback = async (interaction: UserContextMenuCommandInteraction) => {
-    const guild = interaction.guild!;
-    let member = interaction.targetMember;
-    if (!member) member = await guild.members.fetch(interaction.targetId);
-    await userAbout(guild, member as GuildMember, interaction);
+    try {
+        console.log("getting user info")
+        const guild = interaction.guild!;
+        let member = interaction.targetMember as GuildMember | null;
+        if (!member) member = await guild.members.fetch(interaction.targetId);
+        await userAbout(guild, member as GuildMember, interaction);
+    } catch (e) { console.log(e) }
 };
 
 const check = async (_interaction: UserContextMenuCommandInteraction) => {
diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts
index 798678d..d95d66c 100644
--- a/src/events/messageCreate.ts
+++ b/src/events/messageCreate.ts
@@ -8,6 +8,7 @@
 import { ChannelType, GuildMember, Message, ThreadChannel } from "discord.js";
 import singleNotify from "../utils/singleNotify.js";
 
+
 export const event = "messageCreate";
 
 function checkUserForExceptions(user: GuildMember, exceptions: { roles: string[]; users: string[] }) {
@@ -50,7 +51,6 @@
     const { log, isLogging, NucleusColors, entry, renderUser, renderDelta, renderChannel } = client.logger;
 
     const fileNames = await logAttachment(message);
-
     const content = message.content.toLowerCase() || "";
     if (config.filters.clean.channels.includes(message.channel.id)) {
         if (!checkUserForExceptions(message.member!, config.filters.clean.allowed)) return await message.delete();
@@ -58,6 +58,7 @@
 
     const filter = getEmojiByName("ICONS.FILTER");
     let attachmentJump = "";
+    console.log(config.logging.attachments.saved)
     if (config.logging.attachments.saved[message.channel.id + message.id]) {
         attachmentJump = ` [[View attachments]](${config.logging.attachments.saved[message.channel.id + message.id]})`;
     }
diff --git a/src/utils/commandRegistration/register.ts b/src/utils/commandRegistration/register.ts
index d76617c..6b7c225 100644
--- a/src/utils/commandRegistration/register.ts
+++ b/src/utils/commandRegistration/register.ts
@@ -156,7 +156,13 @@
             context.command.setType(ApplicationCommandType.User);
             commands.push(context.command);
 
-            client.commands["contextCommands/user/" + context.command.name] = context;
+            client.commands["contextCommands/user/" + context.command.name] = [
+                context,
+                {
+                    name: context.name ?? context.command.name,
+                    description: context.description ?? context.command.description
+                }
+            ];
 
             console.log(
                 `${last.replace("└", " ").replace("├", "│")}  └─ ${colors.green}Loaded ${
@@ -181,11 +187,15 @@
     client.on("interactionCreate", async (interaction: Interaction) => {
         if (interaction.isUserContextMenuCommand()) {
             const commandName = "contextCommands/user/" + interaction.commandName;
-            await execute(
-                client.commands[commandName]![0]?.check,
-                client.commands[commandName]![0]?.callback,
-                interaction
-            );
+            console.log("trying " + commandName)
+            try {
+                console.log(client.commands[commandName])
+                await execute(
+                    client.commands[commandName]![0]?.check,
+                    client.commands[commandName]![0]?.callback,
+                    interaction
+                );
+            } catch (e) { console.log(e) }
             return;
         } else if (interaction.isMessageContextMenuCommand()) {
             const commandName = "contextCommands/message/" + interaction.commandName;
