replace listitem and undefined objects with strings