diff --git a/src/GenerateHtml.cpp b/src/GenerateHtml.cpp
index a9c8ffc..8379164 100644
--- a/src/GenerateHtml.cpp
+++ b/src/GenerateHtml.cpp
@@ -223,7 +223,9 @@ Json::Value get_data(const Json::Value& data,
}
} else {
out = data[course_id];
- out[key]["prefix"] = course_id.substr(0,4);
+ for(const auto& key : out.getMemberNames()) {
+ if(out[key].isObject()) out[key]["prefix"] = course_id.substr(0,4);
+ }
}
return out;
}