added a tiny error flag test function.