Added a function called before saving a model
Added identity edition