Added extra check for group deletion