fixing socket bug