fixed read error in socket