fix file function