bugfix when applying group hierarchy