changed resend function to fix some timing bugs

Ignore-this: 88764aa2a7d3607fb78c1646b26fa14d

darcs-hash:20140219202424-c21fe-8bcdc8ace740cca61f8fd5c86dc6cb67d80a5adb