Fix infinite loop
Fix infinite loop