fix several bugs. isend problem solved.