fixed a potential infinite loop

oops