refinementsin error checking