diff --git a/bigbluebutton/api/bigbluebutton.py b/bigbluebutton/api/bigbluebutton.py
index 00f870c39da7236d59bd243a4c569aa68da23f55..0ea46ab15b4a6bd96cb35794873175a7c60fa103 100644
--- a/bigbluebutton/api/bigbluebutton.py
+++ b/bigbluebutton/api/bigbluebutton.py
@@ -148,8 +148,8 @@ class BigBlueButton:
             raise BigBlueButtonError("Failed to parse XML response from backend.") from ex
 
         if xml.get("returncode", "FAILED").upper() == "FAILED":
-            message_key = res.get("messageKey", "")
-            message = res.get("message", "Unknown error")
+            message_key = xml.get("messageKey", "")
+            message = xml.get("message", "Unknown error")
 
             ex = BigBlueButtonError(f"Backend returned FAILED response: {message}")
             ex.message_key = message_key
diff --git a/pyproject.toml b/pyproject.toml
index e9195e955645087f32de02ea07135995e7e38bd6..3c79c37c593556da1182c7cf937b6f1855ca32dc 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
 [tool.poetry]
 name = "bigbluebutton2"
-version = "0.1a4"
+version = "0.1a5"
 description = "Sophisticated Python client library for BigBlueButtonâ„¢ with Django integration"
 authors = ["Dominik George <dominik.george@teckids.org>", "Tom Teichler <tom.teichler@teckids.org"]
 license = "MIT"