diff --git a/backend/analysis/management/commands/clear-sessions-history.py b/backend/analysis/management/commands/clear-sessions-history.py
index 548280244f84f36b4e9265a7d856aa9cff0ce0e4..928615dc21cb2307bbff031b66bb1e5f25d6a3aa 100644
--- a/backend/analysis/management/commands/clear-sessions-history.py
+++ b/backend/analysis/management/commands/clear-sessions-history.py
@@ -56,5 +56,5 @@ class Command(BaseCommand):
             # if not, purge it
             history = AnalysisHistory.objects.filter(galaxy_id=galaxy_id)
             if not history.exists():
-                print(f"Delete orphan history {h.name}.")
+                print(f"Delete orphan history {h['name']}.")
                 gu.obj_gi.gi.histories.delete_history(galaxy_id, purge=True)