change code for support python 3.4