replace g.on var with call to window_off()