fix type for python 2, python 3 fix later