pagination: link to previous and next page is now conditional