Save funcion correction