add python2 compatibility