Fix js bug, brendan forgot the var in a for loop ;)