fixed python3 compatibility issue