Added functionality to gether results on submit (if there are no errors)