fixes subset function