This is one of the mentioned cases in the manual. Replace the loop() with a for() loop.