new hazard detect logic