diff --git a/src/commands/settings/rolemenu.ts b/src/commands/settings/rolemenu.ts
index 154fe71..0c174f5 100644
--- a/src/commands/settings/rolemenu.ts
+++ b/src/commands/settings/rolemenu.ts
@@ -163,19 +163,20 @@
     return [name, description];
 };
 
+const defaultRoleMenuData = {
+    name: "Role Menu Page",
+    description: "A new role menu page",
+    min: 0,
+    max: 0,
+    options: []
+};
+
 const editRoleMenuPage = async (
     interaction: StringSelectMenuInteraction | ButtonInteraction,
     m: Message,
     data?: ObjectSchema
 ): Promise<ObjectSchema | null> => {
-    if (!data)
-        data = {
-            name: "Role Menu Page",
-            description: "A new role menu page",
-            min: 0,
-            max: 0,
-            options: []
-        };
+    if (!data) data = _.cloneDeep(defaultRoleMenuData)
     const buttons = new ActionRowBuilder<ButtonBuilder>().addComponents(
         new ButtonBuilder()
             .setCustomId("back")
@@ -472,7 +473,7 @@
                 }
                 case "add": {
                     const newPage = await editRoleMenuPage(i, m);
-                    if (!newPage) break;
+                    if (_.isEqual(newPage, defaultRoleMenuData)) break;
                     currentObject.push();
                     page = currentObject.length - 1;
                     break;
diff --git a/src/commands/settings/tracks.ts b/src/commands/settings/tracks.ts
index 3914a6c..625bcfb 100644
--- a/src/commands/settings/tracks.ts
+++ b/src/commands/settings/tracks.ts
@@ -28,6 +28,7 @@
 import getEmojiByName from "../../utils/getEmojiByName.js";
 import ellipsis from "../../utils/ellipsis.js";
 import { modalInteractionCollector } from "../../utils/dualCollector.js";
+import _ from "lodash";
 
 const { renderRole } = client.logger;
 
@@ -96,7 +97,8 @@
 };
 
 const reorderTracks = async (
-    interaction: ButtonInteraction,
+    interaction: ButtonInteraction | StringSelectMenuInteraction,
+    buttonInteraction: ButtonInteraction,
     m: Message,
     roles: Collection<string, Role>,
     currentObj: string[]
@@ -132,7 +134,7 @@
     let out: StringSelectMenuInteraction | ButtonInteraction | null;
     try {
         out = (await m.awaitMessageComponent({
-            filter: (i) => i.channel!.id === interaction.channel!.id,
+            filter: (i) => i.channel!.id === buttonInteraction.channel!.id,
             time: 300000
         })) as StringSelectMenuInteraction | ButtonInteraction | null;
     } catch (e) {
@@ -152,6 +154,14 @@
     return newOrder;
 };
 
+const defaultTrackData = {
+    name: "",
+    retainPrevious: false,
+    nullable: true,
+    track: [],
+    manageableBy: []
+};
+
 const editTrack = async (
     interaction: ButtonInteraction | StringSelectMenuInteraction,
     message: Message,
@@ -160,13 +170,7 @@
 ) => {
     const isAdmin = (interaction.member!.permissions as PermissionsBitField).has("Administrator");
     if (!current) {
-        current = {
-            name: "",
-            retainPrevious: false,
-            nullable: true,
-            track: [],
-            manageableBy: []
-        };
+        current = _.cloneDeep(defaultTrackData);
     }
 
     const roleSelect = new ActionRowBuilder<RoleSelectMenuBuilder>().addComponents(
@@ -292,7 +296,7 @@
                 }
                 case "reorder": {
                     out.deferUpdate();
-                    current.track = (await reorderTracks(out, message, roles, current.track))!;
+                    current.track = (await reorderTracks(interaction, out, message, roles, current.track))!;
                     break;
                 }
                 case "retainPrevious": {
@@ -466,7 +470,7 @@
                 }
                 case "add": {
                     const newPage = await editTrack(i, m, roles);
-                    if (!newPage) break;
+                    if (_.isEqual(newPage, defaultTrackData)) break;
                     tracks.push();
                     page = tracks.length - 1;
                     break;
