output file bug fixed