fix fling bug with navigating next/prev while scrolling
minor refactoring