the result now is appended to the output file
fix the problem that output is not appended
resolve confict