next button functional with generator on the back end