fix sent header twice bug