Using Event constructor instead of createEvent and eventInit