had typo leading to infinite loop. fixed