recreates the data set each time the submit button is pressed