Fixed bug where form could be submited even if fiels were invalid