Why the form is stuck on submit