And yes, I called the function before changing the index, i fixed it now. Thanks for taking the time to help me!