fix file output bug