I'm working with custom events, and I've run into a problem - when I dispatch the event (with dispatchEvent()) to the body of the page, it won't fire the function I assigned to the event handler, and instead I have to use event listeners. Is there any way to overcome this problem?