added hazard detection