Correctly passing the index in the querySelectorAll callback.