Fixed socket creation bug