added unless nil validation to hazard.rb