proper handling for unclosed value at end of string