Why is my form not submitting and getting stuck?