Fix bug in py2.7