fix error string scope