add beginCapture and endCapture