Form freezes when trying to submit