added missing file close