adding check for length > 0 in buildStr.  empty strings are set by default, so only having a typeof check is not enough