add index to repeat syntax