start/stop capture function