fix for loop formatting

closes #3136