made changes to group lookup logic