Fixed the issue. Was missing the second part of the for loop.