diff --git a/src/caosdb/common/datatype.py b/src/caosdb/common/datatype.py
index eb8c1e4e0088f1924940a104ec3916b9d5d40f99..f8864539314371cbb28858a3ac932da7455d3051 100644
--- a/src/caosdb/common/datatype.py
+++ b/src/caosdb/common/datatype.py
@@ -45,6 +45,8 @@ def LIST(datatype):
 
 def get_list_datatype(datatype):
     """ returns the datatype of the elements in the list """
+    if not isinstance(datatype, str):
+        return None
     match = re.match("LIST(<|&lt;)(?P<datatype>.*)(>|&gt;)", datatype)
 
     if match is not None:
diff --git a/src/caosdb/common/models.py b/src/caosdb/common/models.py
index 731ac751b8eb4c3e170f62e42052e1d027e42e46..67a38321035514e781787ade2f440e072c22424a 100644
--- a/src/caosdb/common/models.py
+++ b/src/caosdb/common/models.py
@@ -2814,7 +2814,7 @@ class Container(list):
             for parents in container_item.get_parents():
                 is_parent.add(parents.id)
             for references in container_item.get_properties():
-                if is_reference(str(references.datatype)):
+                if is_reference(references.datatype):
                     # add only if it is a reference, not a property
                     if(isinstance(references.value, int)):
                         has_references.add(references.value)