made sure the connection between groups and hazard is deleted