Why does the form keep freezing when user hits "submit" button?