write unf to root file and modify fn getFiles