function saleTokens() internal {
        require(currentState != State.Init, "Contract is init, do not accept ether."); 
        require(currentState != State.Refunding, "Contract is refunding, do not accept ether.");
        
        if (currentState == State.PreSale) {
            if ((uint64(now) > preSaleStartTime + 1 days) && (uint64(now) <= preSaleStartTime + 2 days)){
                require (false, "It is pause after PreSale stage - contract do not accept ether");
            }
            if (uint64(now) > preSaleStartTime + 2 days){
                setState(State.PreICO);
                preICOStartTime = uint64(now);
            }
        }

        if (currentState == State.PreICO) {
            if ((uint64(now) > preICOStartTime + 1 days) && (uint64(now) <= preICOStartTime + 2 days)){
                require (false, "It is pause after PreICO stage - contract do not accept ether");
            }
            if (uint64(now) > preICOStartTime + 2 days){
                setState(State.CrowdSale);
                crowdSaleStartTime = uint64(now);
            }
        }        
        
        if (currentState == State.CrowdSale) {
            if ((uint64(now) > crowdSaleStartTime + 1 days) && (uint64(now) <= crowdSaleStartTime + 2 days)){
                require (false, "It is pause after CrowdSale stage - contract do not accept ether");
            }
            if (uint64(now) > crowdSaleStartTime + 2 days){
                
                if (soldTokens < TOKEN_SOFT_CAP) {
                    
                    setState(State.Refunding);
                } else {
                    
                    setState(State.WorkTime);
                    token.lockTransfer(false);
                }
            }
        }        
        
        if (currentState == State.PreSale) {
            require (RPESALE_TOKEN_SUPPLY_LIMIT > soldTokens, "HardCap of Pre-Sale is passed."); 
            require (msg.value >= 1 ether / 10, "Minimum 20 ether for transaction all Pre-Sale period");
        }
        if (currentState == State.PreICO) {
            require (RPEICO_TOKEN_SUPPLY_LIMIT > soldTokens, "HardCap of Pre-ICO is passed.");
            if (now < preICOStartTime + 1 days){
                require (msg.value <= 1 ether / 10, "Maximum is 20 ether for transaction in first day of Pre-ICO");
            }
        }
        crowdsaleBalances[msg.sender] = crowdsaleBalances[msg.sender].add(msg.value);
        uint tokens = saleRate.mul(msg.value);
        tokens = tokens.add(tokens.mul(calcBonus()).div(100));
        token.transfer(msg.sender, tokens);
        soldTokens = soldTokens.add(tokens);
    }