Infinite loop workaround