Modified to control the link displayed on the previous page and the next page.