explain resends and dedupe logic in more detail