fix socket stuff