Fix save function and call in init