fixed py2/py3 issues