tweaked template to get distinct collection names