fix group deletion code