Added a save hook to save button