more before_send changes