fixe a bug with error reporting