subset the data in flatten working