fix coding style
change current path, save the output file with the same name as the input file