fix socket reading issue