fixed problems with Python version > 3.0