next button is working properly