fixed socket factory bug