fixed resend from history
added option to recalculate content-length