fix mongo metadata issues on save