add loop to index