Fixes compatibility issue in afterSave method