fix generated chains