diff --git a/src/commands/mod/purge.ts b/src/commands/mod/purge.ts
index dadab04..1170c33 100644
--- a/src/commands/mod/purge.ts
+++ b/src/commands/mod/purge.ts
@@ -100,7 +100,7 @@
             })) as Discord.Message;
             let component;
             try {
-                component = m.awaitMessageComponent({
+                component = await m.awaitMessageComponent({
                     filter: (i) => i.user.id === interaction.user.id && i.channel!.id === interaction.channel!.id,
                     time: 300000
                 });
@@ -108,12 +108,12 @@
                 timedOut = true;
                 continue;
             }
-            (await component).deferUpdate();
-            if ((await component).customId === "done") {
+            await component.deferUpdate();
+            if (component.customId === "done") {
                 amountSelected = true;
                 continue;
             }
-            const amount = parseInt((await component).customId);
+            const amount = parseInt(component.customId);
 
             let messages: Discord.Message[] = [];
             await (interaction.channel as TextChannel).messages.fetch({ limit: amount }).then(async (ms) => {
@@ -167,7 +167,7 @@
                 guild: interaction.guild.id
             }
         };
-        log(data);
+        await log(data);
         const newOut = await client.database.transcripts.createTranscript(
             "purge",
             deleted,
@@ -209,7 +209,7 @@
             return;
         }
         if (component.customId === "download") {
-            interaction.editReply({
+            await interaction.editReply({
                 embeds: [
                     new EmojiEmbed()
                         .setEmoji("CHANNEL.PURGE.GREEN")
@@ -221,7 +221,7 @@
                 files: [attachmentObject]
             });
         } else {
-            interaction.editReply({
+            await interaction.editReply({
                 embeds: [
                     new EmojiEmbed()
                         .setEmoji("CHANNEL.PURGE.GREEN")
@@ -261,12 +261,12 @@
                 messages = await (channel as TextChannel).bulkDelete(toDelete, true);
             } else {
                 const toDelete = (
-                    await (
-                        await (interaction.channel as TextChannel).messages.fetch({
-                            limit: 100
-                        })
-                    ).filter((m) => m.author.id === user.id)
-                ).first(interaction.options.get("amount")?.value as number);
+                    await (interaction.channel as TextChannel).messages.fetch({
+                        limit: 100
+                    })
+                )
+                    .filter((m) => m.author.id === user.id)
+                    .first(interaction.options.get("amount")?.value as number);
                 messages = await (channel as TextChannel).bulkDelete(toDelete, true);
             }
         } catch (e) {
@@ -326,7 +326,7 @@
                 guild: interaction.guild.id
             }
         };
-        log(data);
+        await log(data);
         const messageArray: Message[] = messages
             .filter(
                 (message) =>
