modify event definition, add event handler in window