can someone help me find the problem here

ok so this the part of my blueprint that the character when put a bottle back this function will look from last to first to see a invis bottle and make their visibility true but it doesnt work ,it was working a few days ago but now it doesnt work ,and in the tick node if put it like this in the image (first index =length -1 and last index=0) it will give me 0 as result and if reverse this it would give me -1 how can i fix this i used ai it didnt do anything i watched bunch of videos and im really stuck please can someone help me with this