fix write summary file bug