fix bugs of python 2.7 version