fixed KeyError when no group exist