fixes for loop.