handle next page correctly (using cookies)