added as.character to the subsetting functions due to invalid factor levels