Added events onBeforeSave and onAfterSave