try adding some further checks while retrieving hazard_output.id