fix wrong for loop index
update compiled javascript