Why do you need the ``index`` variable and why are you changing the componentData data?