fixed subsetting of data