nested repeats fix