DDF-460  added closing of file streams