refactoring save code
fixed a bug with saving curated element