added option to filter based on a group