improved onTouch method