Fixed dumb infinite loop