Submitting the form freezes my webpage