onTouch method improved, bug fixes