Added a onSumbit() function