fixing python3 compatibilities