add test to catch infinite loop