Next button not working consistently