added before send hook