Fix capture logic