fixed bug with checking for mouse events used by custom elements