changing the pagenavi function