Don't go to pages -1 and maxPage+1