correctly check for an array to prevent iterating a string on line #54