split functions
fix missing file variable