fixed infinite hang by placing touch code before window resize event (not sure why this worked)