Fixed "TypeError: Type str doesn't support the buffer API"