Modified capture() method.