avoid undefined value errors when empty string is intended to be printed