Fix save error in the presave function