python 3.x compatibility issue fixed