fixed bugs for ajax async submit of form.