fix socket bug