Fixed the back/next button functionality.