bug fix for loop rule