fix a bug with python 3