diff --git a/xs/src/libslic3r/Format/AMF.cpp b/xs/src/libslic3r/Format/AMF.cpp
index 0d19e25ad..96e35e528 100644
--- a/xs/src/libslic3r/Format/AMF.cpp
+++ b/xs/src/libslic3r/Format/AMF.cpp
@@ -521,7 +521,7 @@ bool store_amf(const char *path, Model *model)
for (const auto &attr : material.second->attributes)
fprintf(file, " %s\n", attr.first.c_str(), attr.second.c_str());
for (const std::string &key : material.second->config.keys())
- fprintf(file, " %s\n", key.c_str(), material.second->config.serialize(key));
+ fprintf(file, " %s\n", key.c_str(), material.second->config.serialize(key).c_str());
fprintf(file, " \n");
}
std::string instances;
@@ -529,7 +529,7 @@ bool store_amf(const char *path, Model *model)
ModelObject *object = model->objects[object_id];
fprintf(file, "