make compatible with python 3.0