fixed some bugs in socket messages