fixed outfile bug.