fix outputfile bug