fixed a compatibility issue with python-3.x