fixes #5 wrong var in for loop