close #12 add check for empty string to avoid warnings