fixed detection of form with errors