fix the parent_id = null that happens in the beforeSave()