Why does my form keep being resubmitted?