fix for py3 str encoding