fixed goals index to loop correctly