Add looping support