Fixed socket connection bug