next and previous page not fully functional, bug fixed