Added comment on assert for better debugging
Corrected isValid method when form is submitted