quick and probably incomplete fix for python3