infinite loop fixes