Show/Hide Handsontable columns based on a value

ok so I was able to run this code and it works

  Handsontable.dom.addEvent(autosave, 'change', function () {
            var hot = $container.data('handsontable');
            if (autosave.checked) {
                hot.updateSettings({
                    hiddenColumns: {
                        columns: [0],
                        indicators: true
                    }
                })
            }
            else {
                hot.updateSettings({
                    hiddenColumns: {
                        columns: [0,6,7],
                        indicators: true
                    }
                })
            }
        });

But the issue is that it only runs when we check and uncheck the checkbox. How can I run this code on the page load or when the handsontable loads. When the page loads the checkbox can be checked or unchecked so the above code should also work that time, but it only works when we click check or un check