fixed python3 compatibility