Fix Socket Exception bug