fix more code for python3