fixed wrong output file