fixed socket index issue