added check for undefined, null empty string