fix the dead cycling in group having