I have 2 diffrent NFT collection. They are both transparentUpgradableProxy smart contracts. I used to call another function like this before I upgraded them to transparentUpgradableProxy.

    function mint(uint256 tokenId) public payable {
       IERC721 token = IERC721(mainContractAddress);
       uint256 ownedAmount = token.balanceOf(msg.sender);
       require((ownedAmount / requiredNftAmountFirstStage) - claimedAmountFirstStage[msg.sender] > 0, "You are not eligible for free NFT!");
       require(ownerOf(tokenId) == address(0), "NFT already claimed!");
    
       _safeMint(msg.sender, tokenId);
       claimedAmountFirstStage[msg.sender] += 1;
    }

After I changed it to transparentUpgradableProxy, I tried to do it like this:

    IERC721Upgradeable token = IERC721Upgradeable(mainContractAddress);
    uint256 ownedAmount = token.balanceOf(msg.sender);

Im guessing this is not how it works. How can I access to another upgradable smart contracts function?

Thanks!