checkErrors function

checkErrors