rewrote SendThread