diff --git a/src/io.c b/src/io.c
index 7a1c3a5f3a722a70a03f835c1d741f29b18f9cb9..e8c57a256c937b344561bd86a520646c91401e02 100644
--- a/src/io.c
+++ b/src/io.c
@@ -598,6 +598,8 @@ void write_output ( char* fileName, struct engine *e)
   /* GADGET-2 legacy values */
   writeAttribute(h_grp, "NumPart_Total", UINT, numParticles, 6);
   writeAttribute(h_grp, "NumPart_Total_HighWord", UINT, numParticlesHighWord, 6);
+  double MassTable[6] = {0., 0., 0., 0., 0., 0.};
+  writeAttribute(h_grp, "MassTable", DOUBLE, MassTable, 6);
   writeAttribute(h_grp, "Flag_Entropy_ICs", UINT, numParticlesHighWord, 6);
   writeAttribute(h_grp, "NumFilesPerSnapshot", INT, &numFiles, 1);