Add some kind of infinite loop protection