adding save button functionality