fixing infinite loop with a break.  yay for infinite loops!