add before_send hook