Fixed bug (missing [$i] so it was not finding the proper array item)