Google graph on meteor works sometimes and sometimes does not work

hi There, i have 2 graphs one is pie chart and other bar chart, pie chart is working in all conditions while bar chart is not working some times, i have listbox with values, the selected listbox value is captured in a session variable.Based on the type of the list box value the graphs should be displayed. changing the listbox value, pie chart is working but bar chart shows blank in chrome while on firefox it shows error* with no details of what the error is. Any idea for this behavior. the following is the code for pie and bar chart.

 Template.DashboardIncomeExpBalancePeriod.onRendered(function() {
    //console.log("iam from dashboard period");
    var currentuserid=Meteor.userId();
        if(currentuserid){
            barChart();
        }
});

function barChart(){
    var currentuserid=Meteor.userId();
    if(currentuserid){
        google.load('visualization', '1.1', {
            'packages': ["bar"],
            callback: drawChart
        });
    }    
    function drawChart() {
    Tracker.autorun(function () {
        console.log("the current accountin draw chart: "+Session.get("SelCurrentAccount"))
        var data = google.visualization.arrayToDataTable(getData());
        var myDiv=document.getElementById('IncomeExpBalancePeriodBarChart')
        var selectedAccount=Session.get("SelCurrentAccount");
        //console.log("in tracker drawchart" + myDiv);
        if( selectedAccount && myDiv && data){
            console.log("the current accountin draw chart: inside if")
            
            var thismonth=moment.monthsShort(moment().month());
            var lastmonth=moment.monthsShort(moment(new Date()).subtract(1,'month').month());
            var varselectedaccount=$('[name=selectAccount]').find("option:selected").text()
            var options = {
              chart: {
                title: 'Your "' + varselectedaccount +  '" Account Performance',
                subtitle: 'Income, and Expenses: ' +  lastmonth  + ' & ' + thismonth ,
              }
            };

            var chart = new google.charts.Bar(document.getElementById('IncomeExpBalancePeriodBarChart'));
            console.log("data values" + data);
            chart.draw(data, options);
            //this is for responsive graphs
            function resizeHandler () {
                console.log("resizeHandler");
                chart.draw(data, options);
            }
            if (window.addEventListener) {
                //console.log("addEventListener");
                window.addEventListener('resize', resizeHandler, false);
            }
            else if (window.attachEvent) {
                //console.log("attachEvent");
                window.attachEvent('onresize', resizeHandler);
            }
        }
    })
    }

}