Add capturehandler to clean up test output