ensure compatibility with python 3