fix for loops