functionality of save button added