diff --git a/extensions/xkcd.py b/extensions/xkcd.py
index 81a8f02aa23da6bc0921b15b8bc5f00ee34a10bc..f585fdd69d3f1750be05c3386a6588af9a1c64a7 100644
--- a/extensions/xkcd.py
+++ b/extensions/xkcd.py
@@ -1,7 +1,9 @@
 import random
+from typing import Dict, Any
 
 import aiohttp
 import discord
+from aiohttp import ClientSession
 from discord import app_commands, Interaction
 from discord.ext import commands
 
@@ -17,34 +19,37 @@ class Xkcd(commands.Cog):
         await interaction.response.defer()
         async with aiohttp.ClientSession() as session:
 
-            # Daten vom aktuellsten Comic holen, um max zu bestimmen
-            async with session.get('http://xkcd.com/info.0.json') as request:
-                data = await request.json()
-            max = data['num']
+            latest = (await self.get_info(session)).get("num")
 
             # Nummer übernehmen wenn vorhanden und zwischen 1 und max, sonst random Nummer wählen
-            if number == 'latest':
-                n = max
-            else:
-                try:
-                    n = number if (number and 0 < int(number) <= max) else str(random.randint(1, max))
-                except ValueError:
-                    n = str(random.randint(1, max))
+            n = number if number and (0 < number <= latest) else random.randint(1, latest)
 
             # Daten zum Bild holen
-            async with session.get(f'http://xkcd.com/{n}/info.0.json') as request:
-                n_data = await request.json()
-
-        img = n_data['img']
-        num = n_data['num']
-        title = n_data['title']
-        text = n_data['alt']
-
-        # Comic embedden
-        embed = discord.Embed(title=f"xkcd #{num}: {title}", description=text, url=f"https://xkcd.com/{num}")
-        embed.set_image(url=img)
-
-        await interaction.edit_original_response(embed=embed)
+            if info := await self.get_info(session, number=n):
+                img = info["img"]
+                num = info["num"]
+                title = info["title"]
+                text = info["alt"]
+
+                # Comic embedden
+                embed = discord.Embed(title=f"xkcd #{num}: {title}", description=text, url=f"https://xkcd.com/{num}")
+                if n != number:
+                    embed.set_footer(text="Du erhältst einen zufälligen Comic, da du entweder keine Nummer eingegeben hast, oder die von dir eingegebene Nummer ungültig war. Viel Spaß :)")
+                embed.set_image(url=img)
+
+                await interaction.edit_original_response(embed=embed)
+                return
+
+        await interaction.edit_original_response(content="Leider ist beim Abrufen des xkcd Comics ein Fehler aufgetreten.")
+
+    @staticmethod
+    async def get_info(session: ClientSession, number: int = None) -> Dict[str, Any]:
+        url = f"http://xkcd.com/{number}/info.0.json" if number else "http://xkcd.com/info.0.json"
+        async with session.get(url) as request:
+            if request.status == 200:
+                return await request.json()
+
+        return {}
 
 
 async def setup(bot: commands.Bot) -> None:
diff --git a/fernuni_bot.py b/fernuni_bot.py
index a43b40847ee689a3ff3fe8ee7a05ef292d8bd345..f3228144aadb421a9273f80293ba5141762ad574 100644
--- a/fernuni_bot.py
+++ b/fernuni_bot.py
@@ -1,4 +1,6 @@
+import logging
 import os
+from logging import DEBUG
 from typing import List
 
 import discord
@@ -19,7 +21,8 @@ OWNER = int(os.getenv('DISCORD_OWNER'))
 PIN_EMOJI = "📌"
 
 intents = Intents.all()
-extensions = ["welcome"]
+extensions = ["welcome", "xkcd"]
+_log = logging.getLogger('discord')
 
 
 class Boty(commands.Bot):
@@ -32,7 +35,7 @@ class Boty(commands.Bot):
         await self.tree.sync()
         for extension in self.initial_extensions:
             await self.load_extension(f"extensions.{extension}")
-            print(f"➕ Module {extension}")
+            _log.info("Module %s loaded", extension)
         await self.sync_slash_commands_for_guild(GUILD_ID)
 
     async def sync_slash_commands_for_guild(self, guild_id):
@@ -48,7 +51,7 @@ class Boty(commands.Bot):
 
     async def on_ready(self):
         self.view_manager.on_ready()
-        print("✅ Client started!")
+        _log.info("Client started!")
 
     @staticmethod
     def get_settings(guild_id: int) -> Settings: