add missing clousure in file loop