Fixed main.js onchange method