work around encoding is None problem