- add onbefore,onaftercreate functions