fix runtimeError to print errors to stdout