Recognizing and handling potential hazards