fix to call beforeMove when clicking on the pagination links

The beforeMove callback wasn't getting called when clicking on the pagination links.