Added condition to handle touch movement on mobile devices