Fix busy-looping