Infinite loop repaired