better nthoftype event handling