fixing up some socket stuff