An apparatus for treating an airspace with a volatile substance includes means for detecting the presence of a specific component in a volatile substance and means for controlling a volatile substance dispenser to dispense the volatile substance only if the volatile substance contains the specific component.