saving works for edit and view