function buy(IERC20Token _connectorToken, uint256 _depositAmount, uint256 _minReturn) internal returns (uint256) {
        uint256 amount;
        uint256 feeAmount;
        (amount, feeAmount) = getPurchaseReturn(_connectorToken, _depositAmount);
        
        require(amount != 0 && amount >= _minReturn);

        
        Connector storage connector = connectors[_connectorToken];
        if (connector.isVirtualBalanceEnabled)
            connector.virtualBalance = safeAdd(connector.virtualBalance, _depositAmount);

        
        assert(_connectorToken.transferFrom(msg.sender, this, _depositAmount));
        
        token.issue(msg.sender, amount);

        
        dispatchConversionEvent(_connectorToken, token, _depositAmount, amount, feeAmount);

        
        emit PriceDataUpdate(_connectorToken, token.totalSupply(), getConnectorBalance(_connectorToken), connector.weight);
        return amount;
    }