improvements to capture logic