Change reference in resources for loop