fix to work in python3