added handling of invalide UTF-8 byte sequence exceptions