Save when pressing save button
Extract 'has edited?' and save button logic into separate function