implemented capturing and bubbling (not tested)