fixup logic