working on save button functionality