Added capturing code