parse index for onPageChange