implemented the save button