Next and previous buttons are now working