fix python2 compatibility