adding and linking next and previous buttons