add file function