fixing outputfile