Add save function.