form freezes when clicking submit