more cleanup of saving output