                     constructorS = []
                     for i in that.constructVars.inputVariables
                         constructorS.push i.varValue
-
-                    that.VM.runTx { block: block, tx: tx, skipBalance: true, skipNonce: true }, (error, result) ->
+                    that.exeVM block, tx, (error, result) ->
                         if error
                             console.error error
                             that.showErrorMessage 508, error

                                        if !error
                                            that.argsToArray self.refs, childFunction, (error, argArray) ->
                                                if !error
                                                    console.log "Will call"
                                                    # Buffer.concat([ ethJSABI.methodID(Method Name, input variable types), ethJSABI.rawEncode(input variable types, input variables) ]).toString('hex')
                                                    buffer = Buffer.concat([ ethJSABI.methodID(childFunction, typArray), ethJSABI.rawEncode(typArray, argArray) ]).toString('hex')
                                                    console.log buffer
                                                    #that.call(myContract, childFunction, argArray)
                                render: ->
                                    self = this
                                    React.createElement 'div', { htmlFor: 'contractFunctions' }, this.state.childFunctions.map((childFunction, i) ->

                else
                    web3.personal.unlockAccount(web3.eth.defaultAccount, Password)
                    result = that.myContract[that.functionName]()
                that.showOutput that.myContract.address, result

    callVM: (@myContract, @functionName, @argTypes, @arguments) ->
        that = this
        to = that.myContract.createdAddress.toString('hex')
        # Buffer.concat([ ethJSABI.methodID(Method Name, input variable types), ethJSABI.rawEncode(input variable types, input variables) ]).toString('hex')
        buffer = Buffer.concat([ ethJSABI.methodID(that.functionName, that.argTypes), ethJSABI.rawEncode(that.argTypes, that.arguments) ]).toString('hex')
        tx = new EthJSTX({
                nonce: new BN(vmAccounts[Coinbase].nonce++),
                gasPrice: new BN(1),
                gasLimit: new BN(3000000, 10),
                to: new Buffer(to, 'hex'),
                value: new BN(0, 10),
                data: new Buffer(buffer, 'hex')
            })
        tx.sign(vmAccounts[Coinbase].privateKey)
        block = new EthJSBlock({
                header: {
                    timestamp: new Date().getTime() / 1000 | 0,
                    number: vmBlockNumber
                },
                transactions: [],
                uncleHeaders: []
            })
        @exeVM block, tx, (error, result) ->
            if error
                console.error error
                that.showErrorMessage 508, error
            else
                console.log result
                that.showOutput 'Method call is yet to be implemented', 'See github issue https://github.com/gmtDevs/atom-ethereum-interface/issues/23'

    exeVM: (@block, @tx, callback) ->
        that = this
        console.log that.block
        console.log that.tx
        VM.runTx { block: that.block, tx: that.tx, skipBalance: true, skipNonce: true }, (error, result) ->
            if !error
                callback(null, result)

    toggle: ->
        if @modalPanel.isVisible()
