added save button functionalities