change captures to ids instead of objects; flag swap fix