Added functionality to submit button.