Fix data type issue in python 3