Made loop auto-end for finite loops