function send buffer to client was not good , now it could be