fix the buffer for socket