add - simplify endCapture, add tests for null or