Fixing the hasErrors method