set preventEvents as public
set id to null if not provided