```\nuint256[] memory liens = LIEN_TOKEN.getLiens(tokenId);\nuint256 totalLienAmount = 0;\nif (liens.length > 0) {\n  for (uint256 i = 0; i < liens.length; ++i) {\n    uint256 payment;\n    uint256 lienId = liens[i];\n\n    ILienToken.Lien memory lien = LIEN_TOKEN.getLien(lienId);\n\n    if (transferAmount >= lien.amount) {\n      payment = lien.amount;\n      transferAmount -= payment;\n    } else {\n      payment = transferAmount;\n      transferAmount = 0;\n    }\n    if (payment > 0) {\n      LIEN_TOKEN.makePayment(tokenId, payment, lien.position, payer);\n    }\n  }\n} else {\n  //@audit-issue logic skipped if liens.length > 0\n  TRANSFER_PROXY.tokenTransferFrom(\n    weth,\n    payer,\n    COLLATERAL_TOKEN.ownerOf(tokenId),\n    transferAmount\n  );\n}\n```\n