added prev next button functionality