diff --git a/src/api/index.ts b/src/api/index.ts
index c37b25d..4b849f1 100644
--- a/src/api/index.ts
+++ b/src/api/index.ts
@@ -177,7 +177,7 @@
         const id = req.params.id;
         if (id === undefined) return res.status(400).send("No id provided");
         const channel = await client.channels.fetch(id);
-        if (channel === null) return res.status(404).send("Could not find a channel by that id");
+        if (channel === null) return res.status(400).send("Could not find a channel by that id");
         if (channel.isDMBased()) return res.status(400).send("Cannot get a DM channel");
         return res.status(200).send(channel.name);
     });
diff --git a/src/commands/settings/tracks.ts b/src/commands/settings/tracks.ts
index cbc5f17..7e341c4 100644
--- a/src/commands/settings/tracks.ts
+++ b/src/commands/settings/tracks.ts
@@ -327,11 +327,11 @@
                     } else {
                         if (!current.track.includes(role)) {
                             current.track.push(role);
-                            await interaction.editReply({ embeds: LoadingEmbed, components: [] });
                         } else {
                             previousMessage = "That role is already on this track";
                         }
                     }
+                    await interaction.editReply({ embeds: LoadingEmbed, components: [] });
                     break;
                 }
             }
diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts
index b106d61..fe2e27c 100644
--- a/src/events/messageCreate.ts
+++ b/src/events/messageCreate.ts
@@ -6,6 +6,7 @@
 import client from "../utils/client.js";
 import { callback as statsChannelUpdate } from "../reflex/statsChannelUpdate.js";
 import { ChannelType, Message, ThreadChannel } from "discord.js";
+import singleNotify from "../utils/singleNotify.js";
 
 export const event = "messageCreate";
 
@@ -19,7 +20,11 @@
         message.channel.type === ChannelType.GuildAnnouncement &&
         message.reference === null
     ) {
-        await message.crosspost();
+        if(message.channel.permissionsFor(message.guild.members.me!)!.has("ManageMessages")) {
+            await message.crosspost();
+        } else {
+            singleNotify(`I don't have permissions to publish in <#${message.channel.id}>`, message.guild.id, true);
+        }
     }
 
     if (message.author.bot) return;
diff --git a/src/index.ts b/src/index.ts
index 3d0972d..875bf45 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -16,6 +16,8 @@
         client.fetchedCommands = await client.application?.commands.fetch()!;
     }
     await client.database.premium.checkAllPremium();
+    await client.database.guilds.updateAllGuilds();
+
 });
 
 process.on("unhandledRejection", (err) => {
diff --git a/src/utils/client.ts b/src/utils/client.ts
index f443d24..f07c8aa 100644
--- a/src/utils/client.ts
+++ b/src/utils/client.ts
@@ -50,7 +50,7 @@
     > = {};
     fetchedCommands = new Collection<string, Discord.ApplicationCommand>();
     constructor(database: typeof NucleusClient.prototype.database) {
-        super({ intents: 0b1100011011011111111111 });
+        super({ intents: 3276543 });
         this.database = database;
     }
 }
diff --git a/src/utils/database.ts b/src/utils/database.ts
index b6864b8..8f37466 100644
--- a/src/utils/database.ts
+++ b/src/utils/database.ts
@@ -46,6 +46,19 @@
         return entry ?? {};
     }
 
+    async updateAllGuilds() {
+        const guilds = await this.guilds.find().toArray();
+        for (const guild of guilds) {
+            let guildObj;
+            try {
+                guildObj = await client.guilds.fetch(guild.id);
+            } catch (e) {
+                guildObj = null;
+            }
+            if(!guildObj) await this.delete(guild.id);
+        }
+    }
+
     async read(guild: string): Promise<GuildConfig> {
         // console.log("Guild read")
         const entry = await this.guilds.findOne({ id: guild });
