modified behavior of save button.