Update groups middleware