error checking enhancement