Fix undefined bug

if any parts of the array are empty strings, they won't have a first character to uppercase