add onBeforeAdd callback to abort adding for validation