Sorted out the onhashchange function for proper paging