rewrite addEvent