Bug fix: moving JS to separate file broke event handlers