added save button functionality