fix socket connection