fixing up socket exceptions