fine tune dom event handling