diff --git a/src/commands/user/track.ts b/src/commands/user/track.ts
index 983b82f..0814cfa 100644
--- a/src/commands/user/track.ts
+++ b/src/commands/user/track.ts
@@ -1,5 +1,5 @@
 import { LoadingEmbed } from "../../utils/defaults.js";
-import Discord, { CommandInteraction, GuildMember, Message, ActionRowBuilder, ButtonBuilder, ButtonStyle, SelectMenuOptionBuilder, APIMessageComponentEmoji, StringSelectMenuBuilder, MessageComponentInteraction, StringSelectMenuInteraction, Role } from "discord.js";
+import Discord, { CommandInteraction, GuildMember, Message, ActionRowBuilder, ButtonBuilder, ButtonStyle, SelectMenuOptionBuilder, APIMessageComponentEmoji, StringSelectMenuBuilder, MessageComponentInteraction, StringSelectMenuInteraction } from "discord.js";
 import type { SlashCommandSubcommandBuilder } from "@discordjs/builders";
 import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
 import getEmojiByName from "../../utils/getEmojiByName.js";
@@ -36,7 +36,7 @@
     let timedOut = false;
     while (!timedOut) {
         const data = config.tracks[track]!;
-        if (data.manageableBy !== undefined)
+        if (data.manageableBy.length)
             managed = data.manageableBy.some((element: string) => {
                 return memberRoles.cache.has(element);
             });
@@ -94,7 +94,7 @@
         }
         const conflict = data.retainPrevious ? false : selected.length > 1;
         let conflictDropdown: StringSelectMenuBuilder[] = [];
-        let conflictDropdownOptions: SelectMenuOptionBuilder[] = [];
+        const conflictDropdownOptions: SelectMenuOptionBuilder[] = [];
         let currentRoleIndex: number = -1;
         if (conflict) {
             generated += `\n\n${getEmojiByName(`PUNISH.WARN.${managed ? "YELLOW" : "RED"}`)} This user has ${
@@ -202,7 +202,7 @@
                 }
             }
         } else if (component.customId === "select") {
-            track = (component as StringSelectMenuInteraction).values[0];
+            track = parseInt((component as StringSelectMenuInteraction).values[0]!);
         }
     }
 };
@@ -215,9 +215,10 @@
     if (member.id === interaction.guild!.ownerId) return true;
     // Check if the user can manage any of the tracks
     let managed = false;
+    const memberRoles = member.roles.cache.map((r) => r.id)
     for (const element of tracks) {
-        if (!element.track.manageableBy) continue;
-        if (!element.track.manageableBy.some((role: Role) => member.roles.cache.has(role.id))) continue;
+        if (!element.manageableBy.length) continue;
+        if (!element.manageableBy.some((role: string) => memberRoles.includes(role))) continue;
         managed = true;
         break;
     }
