I did have the chance to test the script yet, but it seems like that line should be outside the for loop.