added the submit function