Fix a looping issue