function _checkLimit(uint256 _uid, uint256 _planId, uint256 _amount) private {
        Objects.Plan storage plan = investmentPlans_[_planId];
        if (plan.limit > 0) {
            require(plan.leftAmount >= _amount && plan.perInvestorLimit >= _amount, "1 - Not enough limit");

            Objects.Investor storage investor = uid2Investor[_uid];
            uint256 totalInvestment = 0;
            uint256 leftInvestmentLimit = 0;
            for (uint256 i = 0; i < investor.planCount; i++) {
                require(investor.plans[i].investmentDate != 0, "wrong investment date");
                if (investor.plans[i].planId != _planId || investor.plans[i].investmentDate < plan.lastUpdateDate) {
                    continue;
                }
                totalInvestment = totalInvestment.add(investor.plans[i].investment);

            }
            leftInvestmentLimit = (totalInvestment > plan.perInvestorLimit) ? 0 : plan.perInvestorLimit.sub(totalInvestment);

            require(leftInvestmentLimit >= _amount, "2 - Not enough limit");

            plan.leftAmount = plan.leftAmount.sub(_amount);
        }


    }