check for and handle namedtuples when unflattening