Fixing next button to properly validate on click