save function changes