diff --git a/src/caosadvancedtools/json_schema_exporter.py b/src/caosadvancedtools/json_schema_exporter.py
index 49c4a44ab71f6fb4961b0a253777049a98a6fc40..a64b0e05dc438bebf509bed38f02507f394c3d2c 100644
--- a/src/caosadvancedtools/json_schema_exporter.py
+++ b/src/caosadvancedtools/json_schema_exporter.py
@@ -113,7 +113,7 @@ def _make_prop_from_prop(prop: db.Property, additional_properties: bool,
             raise NotImplementedError("Files have not been implemented yet.")
         else:
             values = _retrieve_enum_values(f"RECORD '{prop.datatype}'")
-            rt = db.execute_query(f"FIND RECORDTYPE with name='{prop.datatype}'", unique=True)
+            rt = db.execute_query(f"FIND RECORDTYPE WITH name='{prop.datatype}'", unique=True)
             subschema = _treat_recordtype(rt, additional_properties,
                                           name_and_description_in_properties,
                                           additional_options_for_text_props,
diff --git a/unittests/test_json_schema_exporter.py b/unittests/test_json_schema_exporter.py
index 3dafab2d72cb62fb8dfedf43f5eb2ef45c7721c9..57a45286b2590e857700e8ef41bbac84f9b529a7 100644
--- a/unittests/test_json_schema_exporter.py
+++ b/unittests/test_json_schema_exporter.py
@@ -44,7 +44,7 @@ def _mock_execute_query(query_string, unique=False, **kwargs):
 
     if query_string == "SELECT name, id FROM RECORD 'OtherType'":
         return other_type_records
-    elif query_string == "FIND RECORDTYPE 'OtherType'" and unique is True:
+    elif query_string == "FIND RECORDTYPE WITH name='OtherType'" and unique is True:
         return other_type_rt
     elif query_string == "SELECT name, id FROM RECORD":
         return all_records