works SAVE and EDIT