Improved back button functionality on dynamic Next button.