Having an issue with the loop functionality. Im passing in an array but getting nothing back except null values