Reverted last change and simply check the length of the page.