added onBeforeDelete() thx to @j