Fix to use term slugs correctly

Modified to use term slugs rather than names.