changed touchend handler from plain javascript to jquery event