Added functionality to save button