diff --git a/km3io/offline.py b/km3io/offline.py
index ba4d0e5529f8916da81274673562f7d6b4bf5dc0..4677316320d9bdcdf130cc32ec921438204af46f 100644
--- a/km3io/offline.py
+++ b/km3io/offline.py
@@ -313,7 +313,7 @@ class Reader:
             do not contain data. Therefore, the keys corresponding to these
             fake branches are not read.
         """
-        keys = set(self.keys.valid_keys)
+        keys = self.keys.valid_keys
         if key not in keys and not isinstance(key, int):
             raise KeyError(
                 "'{}' is not a valid key or is a fake branch.".format(key))