fixed problem with redirect if 'next' page is missing