fix a bug: setting a end of string character when it receive a message from client