Another attempt at fixing save_metadata