update save button logic