diff --git a/src/commands/user/about.ts b/src/commands/user/about.ts
index 6ae3231..4701630 100644
--- a/src/commands/user/about.ts
+++ b/src/commands/user/about.ts
@@ -7,9 +7,10 @@
     MessageActionRowComponent,
     MessageButton,
     MessageComponentInteraction,
+    MessageSelectOptionData,
     SelectMenuInteraction
 } from "discord.js";
-import { SelectMenuOption, SlashCommandSubcommandBuilder } from "@discordjs/builders";
+import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
 import getEmojiByName from "../../utils/getEmojiByName.js";
 import generateKeyValueList from "../../utils/generateKeyValueList.js";
@@ -224,22 +225,20 @@
         ephemeral: true
     })) as Message;
     let page = 0;
-    let breakReason = "";
-    while (true) {
+    let timedOut = false;
+    while (!timedOut) {
         const em = new Discord.MessageEmbed(embeds[page].embed);
         em.setDescription(em.description + "\n" + createPageIndicator(embeds.length, page));
         let selectPane = [];
 
         if (selectPaneOpen) {
-            const options = [];
+            const options: MessageSelectOptionData[] = [];
             embeds.forEach((embed) => {
-                options.push(
-                    new SelectMenuOption({
-                        label: embed.title,
-                        value: embed.pageId.toString(),
-                        description: embed.description || ""
-                    })
-                );
+                options.push({
+                    label: embed.title,
+                    value: embed.pageId.toString(),
+                    description: embed.description || ""
+                });
             });
             selectPane = [
                 new MessageActionRow().addComponents([
@@ -269,11 +268,7 @@
                         .setEmoji(getEmojiByName("CONTROL.RIGHT", "id"))
                         .setCustomId("right")
                         .setStyle("SECONDARY")
-                        .setDisabled(page === embeds.length - 1),
-                    new MessageButton()
-                        .setEmoji(getEmojiByName("CONTROL.CROSS", "id"))
-                        .setCustomId("close")
-                        .setStyle("DANGER")
+                        .setDisabled(page === embeds.length - 1)
                 ])
             ])
         });
@@ -281,8 +276,8 @@
         try {
             i = await m.awaitMessageComponent({ time: 300000 });
         } catch {
-            breakReason = "Message timed out";
-            break;
+            timedOut = true;
+            continue;
         }
         i.deferUpdate();
         if ((i.component as MessageActionRowComponent).customId === "left") {
@@ -293,45 +288,16 @@
             selectPaneOpen = false;
         } else if ((i.component as MessageActionRowComponent).customId === "select") {
             selectPaneOpen = !selectPaneOpen;
-        } else if ((i.component as MessageActionRowComponent).customId === "close") {
-            breakReason = "Message closed";
-            break;
         } else if ((i.component as MessageActionRowComponent).customId === "page") {
             page = parseInt((i as SelectMenuInteraction).values[0]);
             selectPaneOpen = false;
-        } else {
-            breakReason = "Message closed";
-            break;
         }
     }
     const em = new Discord.MessageEmbed(embeds[page].embed);
-    em.setDescription(em.description + "\n" + createPageIndicator(embeds.length, page) + " | " + breakReason);
+    em.setDescription(em.description + "\n" + createPageIndicator(embeds.length, page) + " | Message closed");
     await interaction.editReply({
         embeds: [em],
-        components: [
-            new MessageActionRow().addComponents([
-                new MessageButton()
-                    .setEmoji(getEmojiByName("CONTROL.LEFT", "id"))
-                    .setStyle("SECONDARY")
-                    .setCustomId("left")
-                    .setDisabled(true),
-                new MessageButton()
-                    .setEmoji(getEmojiByName("CONTROL.MENU", "id"))
-                    .setStyle("SECONDARY")
-                    .setCustomId("select")
-                    .setDisabled(true),
-                new MessageButton()
-                    .setEmoji(getEmojiByName("CONTROL.RIGHT", "id"))
-                    .setCustomId("right")
-                    .setStyle("SECONDARY")
-                    .setDisabled(true),
-                new MessageButton()
-                    .setEmoji(getEmojiByName("CONTROL.CROSS", "id"))
-                    .setCustomId("close")
-                    .setStyle("DANGER")
-                    .setDisabled(true)
-            ])
-        ]
+        components: []
     });
 };
 
diff --git a/src/commands/user/track.ts b/src/commands/user/track.ts
index da62880..8c991e3 100644
--- a/src/commands/user/track.ts
+++ b/src/commands/user/track.ts
@@ -35,7 +35,8 @@
     const roles = await guild.roles.fetch();
     const memberRoles = member.roles;
     let managed: boolean;
-    while (true) {
+    let timedOut = false;
+    while (!timedOut) {
         const data = config.tracks[track];
         if (data.manageableBy !== undefined)
             managed = data.manageableBy.some((element: string) => {
@@ -169,7 +170,8 @@
         try {
             component = await m.awaitMessageComponent({ time: 300000 });
         } catch (e) {
-            return;
+            timedOut = true;
+            continue;
         }
         component.deferUpdate();
         if (component.customId === "conflict") {
