bugfix: check the error list before going to the first error