improve test case
fix error_stream wrapper