Clicking on next button for first time is not working