view index.php fixed but still have bugs in next and previous pages