refines onSwipe