fix code for python3