How to change the element at a specific index for all sub-lists