socket exception fix