bug fix - prev and next url did not work correctly