Fixed invalid byte sequence issue