fixing UnicodeDecodeError, invalid continuation byte in raw data