check for empty string as well as nil