make the rank fixup recursive