correct a bug with python 2