remove sockets; check proper index