Added the hasErrors() method