diff --git a/src/commands/nucleus/premium.ts b/src/commands/nucleus/premium.ts
index 721bc5c..0b0f553 100644
--- a/src/commands/nucleus/premium.ts
+++ b/src/commands/nucleus/premium.ts
@@ -93,7 +93,7 @@
         if (i.isButton()) {
             closed = true;
         } else {
-            const response = client.database.premium.removePremium(interaction.user.id, i.values[0]!);
+            const response = await client.database.premium.removePremium(interaction.user.id, i.values[0]!);
             console.log(response);
         }
     } while (!closed);
@@ -163,9 +163,10 @@
     const hasPremium = await client.database.premium.hasPremium(interaction.guild!.id);
     let premiumGuild = "";
     if (hasPremium) {
+        const gaveUser = await client.users.fetch(hasPremium[1]);
         premiumGuild = `**This server has premium! It was ${
             hasPremium[2] === 3 && hasPremium[3]
-                ? `automatically applied by <@${hasPremium[1]}>`
+                ? `automatically applied by ${gaveUser.username}#${gaveUser.discriminator}`
                 : `given by <@${hasPremium[1]}>`
         }**\n\n`;
     }
@@ -192,6 +193,9 @@
         );
     }
 
+    let userPremiumServers;
+    if ((dbMember?.appliesTo.length ?? 0) > 0) userPremiumServers = "\nIf you want to remove premium from a server, run this command in your DMs with me.";
+
     interaction.editReply({
         embeds: [
             new EmojiEmbed()
@@ -219,7 +223,7 @@
                 new EmojiEmbed()
                     .setTitle("Premium")
                     .setDescription(
-                        `You have already activated premium on the maximum amount of servers!` + firstDescription
+                        `You have already activated premium on the maximum amount of servers!` + userPremiumServers + firstDescription
                     )
                     .setEmoji("NUCLEUS.PREMIUMACTIVATE")
                     .setStatus("Danger")
@@ -232,7 +236,7 @@
             embeds: [
                 new EmojiEmbed()
                     .setTitle("Premium")
-                    .setDescription(`You have activated premium on this server!` + firstDescription)
+                    .setDescription(`You have activated premium on this server!` + userPremiumServers + firstDescription)
                     .setEmoji("NUCLEUS.LOGO")
                     .setStatus("Danger")
             ],
diff --git a/src/commands/settings/tracks.ts b/src/commands/settings/tracks.ts
index 20972f4..cbc5f17 100644
--- a/src/commands/settings/tracks.ts
+++ b/src/commands/settings/tracks.ts
@@ -163,7 +163,7 @@
         current = {
             name: "",
             retainPrevious: false,
-            nullable: false,
+            nullable: true,
             track: [],
             manageableBy: []
         };
@@ -173,6 +173,7 @@
         new RoleSelectMenuBuilder().setCustomId("addRole").setPlaceholder("Select a role to add").setDisabled(!isAdmin)
     );
     let closed = false;
+    let previousMessage = "";
     do {
         const editableRoles: string[] = current.track
             .map((r) => {
@@ -224,9 +225,9 @@
             new ButtonBuilder()
                 .setCustomId("nullable")
                 .setLabel(`Role ${current.nullable ? "Not " : ""}Required`)
-                .setStyle(current.nullable ? ButtonStyle.Success : ButtonStyle.Danger)
+                .setStyle(current.nullable ? ButtonStyle.Danger : ButtonStyle.Success)
                 .setEmoji(
-                    getEmojiByName("CONTROL." + (current.nullable ? "TICK" : "CROSS"), "id") as APIMessageComponentEmoji
+                    getEmojiByName("CONTROL." + (current.nullable ? "CROSS" : "TICK"), "id") as APIMessageComponentEmoji
                 )
         );
 
@@ -247,7 +248,7 @@
                     }need a role in this track\n` +
                     `${getEmojiByName("CONTROL." + (current.retainPrevious ? "TICK" : "CROSS"))} Members ${
                         current.retainPrevious ? "" : "don't "
-                    }keep all roles below their current highest\n\n` +
+                    }keep all roles below their current highest\n\n` + (previousMessage ? previousMessage + "\n\n": "") +
                     createVerticalTrack(
                         mapped.map((role) => renderRole(role)),
                         new Array(current.track.length).fill(false),
@@ -316,13 +317,20 @@
                 }
             }
         } else {
+            out.deferUpdate();
             switch (out.customId) {
                 case "addRole": {
                     const role = out.values![0]!;
-                    if (!current.track.includes(role)) {
-                        current.track.push(role);
+                    const roleObj = roles.get(role)!;
+                    if (roleObj.position >= (interaction.member as GuildMember).roles.highest.position){
+                        previousMessage = "You can't add a role that is higher than your highest role.";
                     } else {
-                        out.reply({ content: "That role is already on this track", ephemeral: true });
+                        if (!current.track.includes(role)) {
+                            current.track.push(role);
+                            await interaction.editReply({ embeds: LoadingEmbed, components: [] });
+                        } else {
+                            previousMessage = "That role is already on this track";
+                        }
                     }
                     break;
                 }
