Add the capture function