Diaper changing question?

Should you change a diaper when the baby is done pooping or wait a few minutes after?