add before-send hook