diff --git a/src/ragnar/cli.py b/src/ragnar/cli.py
index 226bee2..b6a805c 100644
--- a/src/ragnar/cli.py
+++ b/src/ragnar/cli.py
@@ -19,12 +19,10 @@ def parse_args():
 def bot_task(username, password):
     log.info(f"Created new bot runniner. Username: {username}")
     while True:
-
-        time.sleep(random.randint(1, 50))
-        bot = Bot(username=username, password=password)
-        bot.login()
-
         try:
+            time.sleep(random.randint(1, 50))
+            bot = Bot(username=username, password=password)
+            bot.login()
             bot.fight()
         except Exception as ex:
             log.critical(ex, exc_info=True)