more crash fixes to socketS