Add switch to turn on/off detection