diff --git a/src/calng/CalibrationManager.py b/src/calng/CalibrationManager.py
index ab4eb34d8e1883a1e1987c49d706a7026d48b5c0..6a1aaabc9d5a6771afead09a0d239f2e350f3d60 100644
--- a/src/calng/CalibrationManager.py
+++ b/src/calng/CalibrationManager.py
@@ -1073,7 +1073,7 @@ class CalibrationManager(DeviceClientBase, Device):
         # need are in there, and obtain their API names.
         for host, req_names in hosts.items():
             # Retrieve hostname for nice error messages.
-            hostname = urlparse(self._server_hosts[name]).hostname
+            hostname = urlparse(host).hostname
 
             try:
                 reply = await to_asyncio_future(self._http_client.fetch(