fix the error reporting in the KLD