add listener for swipe event