make currentPageIndex writeable