edge cases with infinite loops