Fix save button function