fixed bug when saving two times the same model and its mappings