nwrap: rewrite the loop for duplication ai entries if socktype not given