Having difficulty using two different for loops in the same resource