make python 3 support compatible with python 2