compatibility with more python versions (python3; 2.7.3)