adjust to python3