add a switch to enable/disable capture