code for comparing errors