Index: trunk/psastro/src/psastroFixChipsTest.c
===================================================================
--- trunk/psastro/src/psastroFixChipsTest.c	(revision 16078)
+++ trunk/psastro/src/psastroFixChipsTest.c	(revision 20271)
@@ -201,5 +201,11 @@
 
 	// save WCS and analysis metadata in update header
-	psMetadata *updates = psMetadataAlloc();
+	// (pull or create local view to entry on readout->analysis)
+	psMetadata *updates = psMetadataLookupMetadata (&status, readout->analysis, "PSASTRO.HEADER");
+	if (!updates) {
+	    updates = psMetadataAlloc ();
+	    psMetadataAddMetadata (readout->analysis, PS_LIST_TAIL, "PSASTRO.HEADER",  PS_META_REPLACE, "psastro header stats", updates);
+	    psFree (updates);
+	}
 
 	// select the raw objects for this readout
@@ -228,12 +234,8 @@
 	    readout->data_exists = false;
 	    psLogMsg ("psastro", 3, "failed to find a solution\n");
-	    psFree (updates);
 	    continue;
 	}
 
 	pmAstromWriteWCS (updates, fpa, chip, NONLIN_TOL);
-	psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSASTRO.HEADER",  PS_DATA_METADATA, "psastro header stats", updates);
-	psFree (updates);
-
     }
 
