files are now correctly closed.