fixed py3 bug