fix unit test write output error