Fixed beforeSaveData callback