infinite loop protection