added example for beforeSave and afterSave callbacks